package git.bds.nyc.applet.api.service.order;

import git.bds.nyc.communal.model.domain.ContractOrder;
import git.bds.nyc.communal.model.dto.OrderDTO;
import git.bds.nyc.page.PageParam;
import git.bds.nyc.page.PageResult;

import java.time.LocalDateTime;

/**
 * @author 成大事
 * @since 2023/2/3 16:22
 */
public interface OrderService {

    /**
     * 下单
     *
     * @param orderDTO 订单dto
     * @return {@link Boolean}
     */
    Boolean placeOrder(OrderDTO orderDTO);

    /**
     * 按页面获取我订单
     *
     * @param pageParam 页面参数
     * @return {@link PageResult}<{@link ContractOrder}>
     */
    PageResult<ContractOrder> getMyOrderPage(PageParam pageParam);


    /**
     * 按id删除订单
     *
     * @param type
     * @param id   订单
     * @return {@link Boolean}
     */
    Boolean delOrderById(int type,Long id);


    /**
     * 按类型获取我订单分页
     *
     * @param pageParam 页面参数
     * @param type      类型
     * @return {@link PageResult}<{@link ContractOrder}>
     */
    PageResult<ContractOrder> getMyOrderPageByType(PageParam pageParam, int type);

    /**
     * 获取指定时间段页面顺序
     *
     * @param pageParam 页面参数
     * @param startTime 开始时间
     * @param endTime   结束时间
     * @return {@link PageResult}<{@link ContractOrder}>
     */
    PageResult<ContractOrder> getOrderOfTheSpecifiedTimePeriodPage(PageParam pageParam, LocalDateTime startTime, LocalDateTime endTime);

    /**
     * 按订单id取消未签名订单
     *
     * @param id 订单id
     * @return {@link Boolean}
     */
    Boolean cancelUnsignedOrderById(Long id);
}
